{include file="public/head" /}

<body>
<div class="x-nav">


</div>
<div class="x-body">
    <div class="layui-row">

    </div>

    <table class="layui-table">
        <thead>
        <tr>
            <th style="text-align: center; font-size: 16px;">openid</th>
            <th style="text-align: center; font-size: 16px;">昵称</th>
            <th style="text-align: center; font-size: 16px;">图片</th>

            <th style="text-align: center; font-size: 16px;">操作</th>

        </tr>
        </thead>
        <tbody>
        {foreach $userlist as $val}
        <tr>
            <td style="text-align: center;">{$val.openid}</td>
            <td style="text-align: center;">{$val.nickname}</td>
            <td style="text-align: center;"><img src="{$val.headimgurl}"  style="width:60px;height:60px"></td>



            <td class="td-manage" style="text-align: center;">

                <a title="删除" onclick="wxuserdel('{$val.id}')"  class="layui-btn layui-btn-danger">
                    删除
                </a>

            </td>

        </tr>
        {/foreach}
        </tbody>
    </table>
    <div class="page">
        <div>
        </div>
    </div>

</div>
<script>

function wxuserdel(id){
    layer.confirm('删除后无法恢复，确定删除吗?', function(){

        $.post('{:url("wxuserdel")}', { id: id}, function(data){
            if(data=='ok'){
                layer.alert("删除成功", {icon: 6},function () {
                    // 获得frame索引
                    var index = parent.layer.getFrameIndex(window.name);
                    //关闭当前frame
                    parent.layer.close(index);
                    window.parent.location.reload();
                });
            }else {
                layer.msg(data);
            }
        })
    })
}




</script>



</body>

</html>